const express = require('express')
// 创建路由对象
const router = express.Router()

const userService = require('../../service/reception/user')
// 导入验证表单数据的中间件
const expressJoi = require('@escook/express-joi')
// 导入需要的验证规则对象
const { login_schema, phone_schema, retrieve_schema } = require('../../schema/reception/user')

// 登录
router.post('/login', expressJoi(login_schema), userService.login)
// 获取手机验证码
router.post('/get_code', expressJoi(phone_schema), userService.getCode)
// 修改密码(找回密码)
router.patch('/password', expressJoi(retrieve_schema), userService.updatePwdPhone)

module.exports = router